package org.example.hansp.reflection.obtainc_class_structure_information;

import org.junit.jupiter.api.Test;

import java.lang.reflect.Constructor;
import java.lang.reflect.Parameter;

public class ConstructorAPI {
    Class<Person> personClass = Person.class;
    @Test
    public void test() {
        Constructor<?>[] constructors = personClass.getConstructors();
        for (Constructor<?> constructor : constructors) {
            System.out.println(constructor.getName());
            System.out.println(constructor.getParameterTypes().length);
            System.out.println(constructor.getModifiers());
            Parameter[] parameters = constructor.getParameters();
            for (Parameter parameter : parameters) {

                System.out.print(parameter.getName()+"\t");
            }
        }
    }
}
